﻿/*
Copyright (c) 2009 Vratislav Cermak (vratacermak@gmail.com)
 
This file is part of TeachMe Project. See http://code.google.com/p/teach-me for more information.
 
TeachMe is an open source project. Using of TeachMe is free of charge.
It is distributed under GNU General Public License version 3 (GPLv3).
GPLv3 can be found at http://www.gnu.org/licenses/gpl.html.
 
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the license for more details.
*/

using System;
using System.Diagnostics;
using System.Windows.Forms;
using TeachMe.Application.Properties;

namespace TeachMe.Application.Forms
{
    public partial class AboutForm : PseudoModalForm
    {
        private readonly Root _root;

        public AboutForm(Root root)
        {
            _root = root;

            InitializeComponent();

            txVersion.Text = String.Format(Resources.Version, root.CurrentVersion);
        }

        private void OnLicenseClick(object sender, EventArgs e)
        {
            _root.FormsManager.ShowMemoForm(this, Resources.License, Utilities.ReadTextResource("TeachMe.Application.Embedded.License.txt"));
        }

        private void OnCreditsClick(object sender, EventArgs e)
        {
            _root.FormsManager.ShowMemoForm(this, Resources.Credits, Utilities.ReadTextResource("TeachMe.Application.Embedded.Credits.txt"));
        }

        private void onWebsiteClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("http://www.teachme.cz");
        }

        private void OnVersionClick(object sender, EventArgs e)
        {
            OnlineVersionChecker.Check(_root, false, this);
        }
    }
}
